package com.glfx.utils;

import com.sun.deploy.util.StringUtils;
import org.jsoup.internal.StringUtil;

import java.io.*;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

/**
 * @author 柧麟浮休
 * @date 2022/7/25
 */
public class TxTFileReader {

    /**
     * @return 去除的名词符号集合
     */
    public static List<String> getTxTContent() {
        try {
            List<String> list = new ArrayList<>();
            URL url = ClassLoader.getSystemResource("source/ignore.txt");
            InputStream is = url.openStream();
            BufferedReader br = new BufferedReader(new InputStreamReader(is));
            String line;
            while ((line = br.readLine()) != null) {
                if (!StringUtil.isBlank(line)) {
                    list.add(line);
                }
            }
            return list;
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }


}
